<template>
  <div class="main">
    <nav-bar class="home-nav">
      <div class="left" slot="left" @click="goBack">
        <van-icon name="arrow-left" size="24"/>
      </div>
      <div slot="center">溯源码详情</div>
    </nav-bar>

    <div class="item_box" v-for="item in recordList">
     {{item.create_date}}共生成{{item.level}}码<span class="span1">{{item.numbers}}个</span>，已使用<span class="span2">{{item.prints}}个</span>
    </div>

  </div>
</template>

<script>
  import NavBar from "@/components/common/navbar/NavBar"
    export default {
        name: "qrcodeDetail",
      components:{
        NavBar
      },

      data(){
          return {
            level_id:'',
            batch_id:'',
            recordList:'',
          }
      },

      created() {
        this.batch_id = this.$route.query.batch_id;
        this.level_id = this.$route.query.level_id;
        this.getRecordList();
      },

      methods: {
        getRecordList(){
          let that = this;
          that.$http.get('/api/MobileAadminApi/getQrcodeList', {batch_id:that.batch_id,level_id:that.level_id}, r => {
            console.log('生成记录',r);
            that.recordList = r.data;
          })
        },

        goBack(){
          this.$router.go(-1);
        },

      },
    }
</script>

<style scoped>
  .item_box{
    padding: 12px;
    margin: 10px;
    font-size: .28rem;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden
  }
  .item_box .span1{
    color: var(--color-tint);
  }
  .item_box .span2{
    color: #ff3b30;
  }
</style>
